from selenium.webdriver.common.by import By
from selenium import webdriver
from selenium.webdriver.common.devtools.v85.debugger import set_return_value
from selenium.webdriver.remote.webelement import WebElement
from selenium.webdriver.support.ui import WebDriverWait


class Base():
    #初始化浏览器
    def __init__(self,driver):
        self.driver=driver

    #打开网址
    def goto(self,url):
        self.driver.get(url)
    #封装定位操作
    def find_element(self,loc):
        return self.find_element(*loc)
    #封装点击
    def click(self,loc):
        self.find_element(loc).click()
    #封装输入
    def send_keys(self,loc,info):
        self.find_element(loc).send_keys(info)
    #获取元素文本断言
    def text(self,loc):
        return self.find_element(loc).text
